/*
** my_put_in_list.c for lib in /home/nadali_t//local/svn/tek2ed/my_select
** 
** Made by thomas nadalie
** Login   <nadali_t@epitech.net>
** 
** Started on  Sun Nov 25 15:41:43 2012 thomas nadalie
** Last update Sun Nov 25 18:09:02 2012 thomas nadalie
*/

#include	<stdlib.h>
#include	"my.h"

t_list		*my_put_in_list(t_list **list, char *arg)
{
  static int	i = 0;
  t_list        *new;

  if ((new = malloc(sizeof(*list))) == NULL)
    my_put_error("Malloc failed in fill_list\n");
  new->arg = my_strdup(arg);
  //tputs(tgoto(tgetstr("us", NULL), 0, 0), 1, my_putchar);
  my_putstr(new->arg);
  //tputs(tgoto(tgetstr("ue", NULL), 0, 0), 1, my_putchar);
  my_putchar('\n');
  new->x = 0;
  new->y = i++;
  new->prev = (*list)->prev;
  new->next = (*list)->next;
  (*list)->prev->next = new;
  (*list)->prev = new;
  return (0);
}
